#pragma once

#include <iostream>
#include <string>

class Util
{
public:
    // xxxx xxx xxx\r\nYYYY
    static std::string getOneLine(std::string &inbuffer, const std::string &sep)
    {
        auto pos = inbuffer.find(sep);
        if (pos == std::string::npos)
            return "";
        std::string sub = inbuffer.substr(0, pos);

        // 把 sub 从 inbuffer 里面截取出去
        inbuffer.erase(0, sub.size() + sep.size());
        return sub;
    }
};
